import { createStore, createLogger } from 'vuex'
import user from './modules/user'
import cart from './modules/cart'
import cate from './modules/cate'
// 导入vuex数据持久化插件
import createPersistedState from 'vuex-persistedstate'

export default createStore({
  modules: {
    user,
    cart,
    cate
  },
  // 注册插件
  plugins: [
    createPersistedState({
      key: 'rabbit-data-t5',
      paths: ['user', 'cart']
    }),
    createLogger()
  ]
})
